/**
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Autogenerated file -- DO NOT EDIT!

<%= Common::include_plugin_files "bytecodeopt", "codegen_visitors_inc" %>

<%plugins_overrides = Hash.new()
  Common::each_plugin_suboption("bytecodeopt", "codegen_visitors_overrides") do |codegen_visitors_overrides, plugin_lang|
    codegen_visitors_overrides.each do |visitor|
      plugins_overrides[visitor].nil? ? plugins_overrides[visitor] = [].append(plugin_lang)
                                      : plugins_overrides[visitor].append(plugin_lang)
    end
  end
  ["LoadObject", "LoadStatic", "StoreObject", "StoreStatic"].each do |visitor|%>
static bool TryPlugin<%= visitor %>Visitor(GraphVisitor *v, [[maybe_unused]] Inst *inst) {
    [[maybe_unused]] auto lang = static_cast<CodeGenStatic*>(v)->GetGraph()->GetLanguage();
% if plugins_overrides[visitor]
%   plugins_overrides[visitor].each do |lang|
    if (lang == <%= Common::plugins[lang]["lang_enum"] %>) {
        return <%= lang.capitalize %>Visit<%= visitor %>(v, inst);
    }
%   end
% end
    return false;
}
% end
